package com.wsd.smartcarwasher.util;

import com.wsd.smartcarwasher.domain.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class ShiroUtils {


    public static Subject getSubjct() {
        return SecurityUtils.getSubject();
    }
    public static Admin getUser() {
        Object admin = getSubjct().getPrincipal();
        return (Admin)admin;
    }
    public static Long getUserId() {
        return getUser().getId().longValue();
    }
    public static void logout() {
        getSubjct().logout();
    }

}
